home *** CD-ROM | disk | FTP | other *** search
/ Amiga Mag HDD Backup / Amiga Mag HDD Backup.zip / Amiga Mag HDD Backup / Alexander.img.bin / Alexander.img / ***9.11 All NEWer important / 10.2 / Callaway⁄Dec ARexx / austime2.rexx < prev    next >
OS/2 REXX Batch file  |  1983-05-04  |  3KB  |  87 lines

  1. /* AUSTIME2.REXX Convert to time in Australia NSW */
  2. /* Copyright 1994 by Merrill Callaway             */
  3. PARSE ARG help
  4. IF help = '?' THEN DO
  5.    say 'AusTime2 copyright 1994 by Merrill Callaway'
  6.    say 'Program outputs table of times in Mountain Time'
  7.    say 'with corresponding time/day in Sydney, Australia.'
  8.    say 'Automatic seasonal adjustments for Daylight Time here/there.'
  9.    say 'Shows only those times of day that MCI International'
  10.    say 'calling service is discounted (from America).'
  11.    say 'If "Y" or "yes" is given for Business Hours?'
  12.    say 'Then only those times in Sydney are displayed that'
  13.    say 'fall between 8 AM and 5 PM Sydney time, on a business day.'
  14.    say 'Adjusts for business hours when calling from USA on Friday-Sunday.'
  15.    say 'shows more business hours there on Monday if calling on Sunday.'
  16.    say 'Calling on Friday for business hours generates a warning'
  17.    say 'that Saturday may not be a business day, and calling on'
  18.    say 'Saturday will not let you ask for business hours there on Sunday.'
  19.    say ''
  20.    end
  21. datenow=DATE()
  22. PARSE VAR datenow day month year
  23. leap=0
  24. IF year//4=0 THEN leap=1
  25. daynow=DATE(d)
  26. IF (daynow>93+leap) & (daynow< 303 + leap) THEN add=16
  27. ELSE add=18
  28. SAY 'Business hours?'
  29. PULL answer
  30. IF abbrev(answer,'Y') THEN biz=1;else biz=0
  31.  
  32. today=DATE(w)
  33. SELECT
  34.    WHEN today='Monday' THEN tomorrow='Tuesday'
  35.    WHEN today='Tuesday' THEN tomorrow='Wednesday'
  36.    WHEN today='Wednesday' THEN tomorrow='Thursday'
  37.    WHEN today='Thursday' THEN tomorrow='Friday'
  38.    WHEN today='Friday' THEN DO
  39.       tomorrow='Saturday'
  40.       weekend=caution
  41.    END
  42.    WHEN today='Saturday' THEN DO
  43.       tomorrow='Sunday'
  44.       weekend=noway
  45.    END
  46.    WHEN today='Sunday' THEN DO
  47.       tomorrow='Monday'
  48.       weekend=ok
  49.    END
  50.    OTHERWISE NOP
  51. END
  52.  
  53. IF weekend=caution THEN SAY 'Caution! Saturday may NOT be a workday.'
  54. IF weekend=noway & biz THEN DO
  55.    SAY 'NO Business on Sunday!'
  56.    SAY 'Do not ask for business hours.'
  57.    CALL austime2.rexx
  58.    EXIT
  59. END
  60. DO hours=1 TO 24
  61.    IF hours>13 & hours<22 THEN prefix='';ELSE prefix='CALLPAC'
  62.    timenow=hours
  63.    daynow=today
  64.    IF hours = 24 THEN daynow=tomorrow
  65.    IF hours+add<24  THEN DO
  66.       hoursthere=hours+add
  67.       daythere=today'.'
  68.    END
  69.    ELSE DO
  70.       hoursthere=(hours+add)//24
  71.       daythere=tomorrow'.'
  72.    END
  73.    IF timenow=24 THEN timenow=0
  74.    IF biz then if hoursthere>8 & hoursthere<17 THEN DO
  75.       IF prefix~='' | weekend=OK THEN,
  76.           SAY 'Here: 'format(timenow,2,2) daynow' ==> Australia: 'format(hoursthere,2,2) daythere
  77.    END
  78.    IF ~biz THEN if prefix~='' | weekend=OK then,
  79.        SAY 'Here: 'format(timenow,2,2) daynow' ==> Australia: 'format(hoursthere,2,2) daythere
  80. END
  81. EXIT
  82.  
  83. format: PROCEDURE
  84. PARSE ARG num, before, after
  85. num=RIGHT(num,before,0)
  86. num=num||':'COPIES('0',after)
  87. RETURN num